<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>

<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/formValidator.js"/>" type="text/javascript" charset="UTF-8"></script>
<script src="<s:url value="/script/formValidatorRegex.js"/>" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="<s:url value="/script/DateTimeMask.js"/>" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({autotip:true,onerror:function(msg){alert(msg)}});
	$("input:text[name='productManager.product.name']").formValidator({tipid:"producttip",onshow:"请选择产品"}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"您没有选择产品"}});
	$("input:text[name='productManager.person.name']").formValidator({tipid:"persontip",onshow:"请选择产品负责人"}).inputValidator({min:1,max:300,onerror:"您没有选择产品负责人"});
});
</script>
<script language="javascript" src="<s:url value="/script/ShowProcessBar.js"/>" type="text/javascript"></script>

<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link rel="stylesheet" href="<s:url value="/css/validator.css"/>">

</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<s:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img
						src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
						height="12" /></td>
					<td>当前位置：产品管理人员维护</td>
				</tr>
			</table>
			</td>
		</tr>
	<tr>
		<td background="<s:url value="/images/home_4a.gif"/>">
		<table width="980" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
			<tr>
				<td width="20%" valign="top">
				<table width="980" height="400"  border="0" cellspacing="0" cellpadding="0"
					align="center" bgcolor="#FFFFFF">
					<tr>
						<td width="240" valign="top" class="leftbg">
						<%@ include file="/commons/include/pmng_left.inc"%>  
						</td>
						<td valign="top" align="center"><br>
						<s:form action="saveProductManager.action"
							namespace="/security" method="post" 
							onsubmit="return $.formValidator.pageIsValid('1')" >
							<input type="hidden" name="productManager.id"
								value="${productManager.id}">
							<table width="660" border="0" cellspacing="0" cellpadding="0"
								background="<s:url value="/images/catalog_manage_8b.gif"/>">
								<tr>
									<td><img
										src="<s:url value="/images/catalog_manage_8.gif"/>"
										width="660" height="11" alt=""></td>
								</tr>
								<tr>
									<td>
									<TABLE width="90%" cellSpacing=1 cellPadding=0 align="center">
										<TR height=30>
											<TD align=left width="10%"><input type="submit" IsShowProcessBar="True"
												name="Submit" value="保 存"> <input type="button"
												value="返 回"
												onClick="location.href='listProductManager.action'">
											</TD>
										</TR>
									</table>
									<s:if test="#returnMsg==null">
									</s:if> <s:else>
										<TABLE width="80%" cellSpacing=1 cellPadding=0 align="center">
											<TR height=30>
												<TD align=left width="10%"><font color="red">${returnMsg}</font>
												</TD>
											</TR>
										</table>
									</s:else>
									<table width="90%" border="0" cellspacing="0" cellpadding="7"
										align="center" class=tablecolor2>
										<tr>
											<td width="25%" bgcolor="D6E3FA">
											<div align="right"><font color="red">*</font>所属产品：</div>
											</td>
											<td width="">	
												<input type="hidden" name="productManager.product.id" value="${productManager.product.id}">
												<input type="text" name="productManager.product.name" id="product_name"
													value="${productManager.product.name}" readonly>
												<input type="button" name="selType" value="选择产品"
													onClick="selectProduct()" />
												<div id="producttip" style="width:auto"></div></td>
										</tr>
										<tr>
											<td width="" bgcolor="D6E3FA">
											<div align="right"><font color="red">*</font>负&nbsp;责&nbsp;人：</div>
											</td>
											<td width="">
											  	<input type="hidden" name="productManager.person.id" value="${productManager.person.id}">
						                      	<input type="text" name="productManager.person.name" id="person_name" 
													value="${productManager.person.name}" readonly>
											  	<input type="button" name="selType" value="选择人员" onClick="selectMainPerson()"/>
												<div id="persontip" style="width:auto"></div>
											</td>
										</tr>
										<tr>
											<td width="" bgcolor="D6E3FA">
											<div align="right"><font color="red">*</font>是否主要负责人：</div>
											</td>
											<td width="">
											<select name="productManager.isPrimary">
												<option value="0">否</option>
												<option value="1">是</option>
											</select>
											</td>
										</tr>
										<input type="hidden" name="productManager.creator"
											value="${productManager.creator}">
										<input type="hidden" name="productManager.begin"
											value="<s:date name="productManager.begin" format="yyyy-MM-dd HH:mm:ss"/>">
										<input type="hidden" name="productManager.end"
											value="<s:date name="productManager.end" format="yyyy-MM-dd HH:mm:ss"/>">
									</table>
									</td>
								</tr>
								<tr>
									<td><img
										src="<s:url value="/images/catalog_manage_8a.gif"/>"
										width="660" height="9"></td>
								</tr>
							</table></td>
					</tr>
				</table>
				</s:form> 
</body>
</html>
<script>
<!--
	function uploadFile(id) {
		window
				.open(
						'<s:url value="/common/uploadFile.action?attach.refEntity=PRODUCTREFERENCE&attach.refEntityID=" escapeAmp="false"/>'
								+ id, "uploadfile",
						"dialogWidth=420px;dialogHeight=300px");
	}
	
	function addComponent()
	{
		var uploadHTML=document.createElement("<input type='file'　name='upload'/>");
		document.getElementById("files").appendChild(uploadHTML);
		uploadHTML=document.createElement("<p/>");
		document.getElementById("files").appendChild(uploadHTML);
	}
	
	function selectMainPerson(){
	     var url='<s:url value="/organ/toOrganTree.action?type=&path=toPersonTree&module=radio&date=" escapeAmp="false"/>'+'<%=System.currentTimeMillis()%>';
		 var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:800px;dialogHeight:600px;scroll:yes;");
		 if(returnData){
		 	document.forms[0]["productManager.person.name"].value=returnData[1];
		 	document.forms[0]["productManager.person.id"].value=returnData[0];
		 }
	}
	
	function selectProduct(){
	     var url='<s:url value="/xtreecheckbox/selectProduct.jsp?module=radio&date=" escapeAmp="false"/>'+'<%=System.currentTimeMillis()%>';
			var returnData = window.showModalDialog(url, window,
					"status:no;dialogWidth:800px;dialogHeight:600px;scroll:yes;");
			if (returnData) {
				document.forms[0]["productManager.product.name"].value = returnData[1];
				document.forms[0]["productManager.product.id"].value = returnData[0];
			}
	}

var obj1=document.getElementById("iTR2");
if(obj1){
	obj1.style.backgroundColor="B3DEF4";
}
-->
</script>